package com.deyuanyun.pic.pbf.controller.dto.defect.repair;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.common.util.StringUtils;
import com.deyuanyun.pic.common.util.format.NumberFormat;
import com.deyuanyun.pic.pbf.domain.RepairComposites;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;

/**
 * 1,复合材料补强修复表
 *
 * @author huanglw
 * @date 2016-6-27
 *
 * History: [修改人][时间][修改描述]
 */
public class RepairCompositesDto extends RepairDto {

    /**
     * 修复方法：湿缠绕法；预成型法
     */
    private String repairMethod;

    /**
     * 修复材料：玻璃纤维；芳纶纤维；碳纤维
     */
    private String repairMaterial;

    /**
     * 修复长度
     */
    private String repairLength;

    /**
     * 修复层数
     */
    private String repairLayer;

    /**
     * 管表温度（℃）
     */
    private String surfaceTemperature;

    /**
     * 环境温度（℃）
     */
    private String environmentalTemperature;

    /**
     * 固化时间（min）
     */
    private String solidificationTime;

    /**
     * 巴氏硬度（HBa）
     */
    private String hardness;

    /**
     * 修复材料厂商
     */
    private String materialManufacturer;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public RepairCompositesDto(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public String getRepairMethod() {
        return repairMethod;
    }

    public void setRepairMethod(String repairMethod) {
        this.repairMethod = repairMethod;
    }

    public String getRepairMaterial() {
        return repairMaterial;
    }

    public void setRepairMaterial(String repairMaterial) {
        this.repairMaterial = repairMaterial;
    }

    public String getRepairLength() {
        return repairLength;
    }

    public void setRepairLength(String repairLength) {
        this.repairLength = repairLength;
    }

    public String getRepairLayer() {
        return repairLayer;
    }

    public void setRepairLayer(String repairLayer) {
        this.repairLayer = repairLayer;
    }

    public String getSurfaceTemperature() {
        return surfaceTemperature;
    }

    public void setSurfaceTemperature(String surfaceTemperature) {
        this.surfaceTemperature = surfaceTemperature;
    }

    public String getEnvironmentalTemperature() {
        return environmentalTemperature;
    }

    public void setEnvironmentalTemperature(String environmentalTemperature) {
        this.environmentalTemperature = environmentalTemperature;
    }

    public String getSolidificationTime() {
        return solidificationTime;
    }

    public void setSolidificationTime(String solidificationTime) {
        this.solidificationTime = solidificationTime;
    }

    public String getHardness() {
        return hardness;
    }

    public void setHardness(String hardness) {
        this.hardness = hardness;
    }

    public String getMaterialManufacturer() {
        return materialManufacturer;
    }

    public void setMaterialManufacturer(String materialManufacturer) {
        this.materialManufacturer = materialManufacturer;
    }

    public void fromDomain(RepairComposites domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 修复方法：湿缠绕法；预成型法
        this.repairMethod = CodeUtil.getName(domain.getRepairMethod());
        // 修复材料：玻璃纤维；芳纶纤维；碳纤维
        this.repairMaterial = CodeUtil.getName(domain.getRepairMaterial());
        // 修复材料厂商
        this.materialManufacturer = domain.getMaterialManufacturer();
        // 修复长度
        this.repairLength = NumberFormat.format(domain.getRepairLength());
        // 修复层数
        this.repairLayer = StringUtils.convertObjectToString(domain.getRepairLayer());
        // 环境温度（℃）
        this.environmentalTemperature = NumberFormat.format(domain.getEnvironmentalTemperature());
        // 管表温度（℃）
        this.surfaceTemperature = NumberFormat.format(domain.getSurfaceTemperature());
        // 固化时间（min）
        this.solidificationTime = StringUtils.convertObjectToString(domain.getSolidificationTime());
        // 巴氏硬度（HBa）
        this.hardness = StringUtils.convertObjectToString(domain.getHardness());

        // 赋值
        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }
}